import { http } from '/@/utils/http';
import type {
  TypeListResultModel,
  CommunityListResultModel,
  CommunityListParams,
} from './model/community_typeModel';

export function querycommunity_typeModelList() {
  return http.post<TypeListResultModel>({
    url: '/api/app/community/type/list',
  });
}

// 我关注的社区列表 登录需要传user_id
export function queryCommunitySubPage() {
  return http.post<CommunityListResultModel>({
    url: '/api/web/community/community/community_sub_page',
  });
}

// 社区列表接口 传recommend 0
export function queryCommunityList(params: CommunityListParams) {
  return http.post<CommunityListResultModel>({
    url: '/api/app/community/community/list',
    params,
  });
}

export function changeSubscribe(
  community_id: number | undefined,
  is_subscribe: boolean | string | undefined,
) {
  return http.post({
    url: '/api/web/community/community/subscribe',
    params: {
      community_id,
      is_subscribe,
    },
  });
}
